package com.glsc.ngateway.common.oc.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.sql.DataSource;

/**
 * @Author: zzp
 * @Date: 20200527
 * @Desc: 多DataSource配置
 */

@Configuration
public class OcDataSourceDefConfig {

    public static final String DS_MYSQL_OC = "datasourceMysqlOc";

    @Bean(name = DS_MYSQL_OC)
    @ConfigurationProperties("spring.datasource.mysqloc")
    public DataSource datasourceMysqlOc() {
        return DataSourceBuilder.create().build();
    }

}